<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../org/angular.min.js"></script>
</head>
<body>
    <div ng-app="vm" ng-controller="ctrl">
        <span>{{data}}</span>
         <button ng-click="orderBy()"></button>
    </div>
   <script>
       var vm = angular.module('vm',[]);
       vm.controller('ctrl',['$scope',"$filter",function($scope,$filter){
          $scope.data = [
              {id:1,click: 100,title:'后盾人'},
              {id:2,click: 200,title:'PHP'},
              {id:3,click:300,title:'后盾网'}
          ]
          $scope.boo = true;
            $scope.orderBy = function(){
              $scope.data = $filter('orderBy')($scope.data,'id',$scope.boo=!$scope.boo)
            }
       }])
   </script> 
</body>
</html>